package com.wx.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wx.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>Title:      SysPatient. </p>
 * <p>Description 患者信息表 </p>
 * <p>Copyright: Copyright (c) 2016</p>
 * <p>Company:    医百科技有限公司 </p>
 *
 * @author         yangwensheng@100doc.com.cn
 * @since      2021-03-25 10:08:31
 */
@Table(name = "sys_patient")
@Data
@ApiModel(value = "SysPatient")
public class SysPatient extends BaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 真实姓名
	 */
	@Column(name = "real_name")
	@ApiModelProperty(value = "真实姓名")
	@NotEmpty(message = "姓名不能为空")
	private String realName;
	/**
	 * 性别 1:男 2:女
	 */
	@Column(name = "sex")
	@ApiModelProperty(value = "性别 1:男 2:女")
//	@NotNull(message = "性别不能为空")
	private Integer sex;

	/**
	 * 入组编号
	 */
	@Column(name = "join_code")
	@ApiModelProperty(value = "入组编号(电子ICF编号)")
	private String joinCode;

	/**
	 * 年龄
	 */
	@Column(name = "age")
	@ApiModelProperty(value = "年龄")
	private String age;
	/**
	 * 身高
	 */
	@Column(name = "height")
	@ApiModelProperty(value = "身高")
	private BigDecimal height;
	/**
	 * 体重
	 */
	@Column(name = "weight")
	@ApiModelProperty(value = "体重")
	private BigDecimal weight;
	/**
	 * 出生日期
	 */
	@Column(name = "birthday")
	@ApiModelProperty(value = "出生日期")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date birthday;
	/**
	 * 证件类型 1：身份证 2：护照
	 */
	@Column(name = "certificates_type")
	@ApiModelProperty(value = "证件类型 1：身份证 2：护照")
	private Integer certificatesType;
	/**
	 * 身份证号
	 */
	@Column(name = "id_num")
	@ApiModelProperty(value = "身份证号")
	private String idNum;
	/**
	 * 联系方式
	 */
	@Column(name = "phone")
	@ApiModelProperty(value = "联系方式")
	@NotEmpty(message = "手机号不能为空")
	private String phone;
	/**
	 * 备用联系方式
	 */
	@Column(name = "phone_back")
	@ApiModelProperty(value = "备用联系方式")
	private String phoneBack;
	/**
	 * 邮箱
	 */
	@Column(name = "email")
	@ApiModelProperty(value = "邮箱")
	private String email;
	/**
	 * openId
	 */
	@Column(name = "open_id")
	@ApiModelProperty(value = "openId")
	private String openId;
	/**
	 * 当前入组医院Id
	 */
	@Column(name = "hospital_id")
	@ApiModelProperty(value = "当前入组医院Id")
	private String hospitalId;

	/**
	 * 入组省份Id
	 */
	@Column(name = "join_province_id")
	@ApiModelProperty(value = "入组省份Id")
	private String joinProvinceId;
	/**
	 * 居住城市
	 */
	@Column(name = "join_city_id")
	@ApiModelProperty(value = "入组城市Id")
	private String joinCityId;
	/**
	 * 居住省份Id
	 */
	@Column(name = "live_province_id")
	@ApiModelProperty(value = "居住省份Id")
	private String liveProvinceId;
	/**
	 * 居住城市
	 */
	@Column(name = "live_city_id")
	@ApiModelProperty(value = "居住城市")
	private String liveCityId;
	/**
	 * 医保类型：0：城镇职工 1：新农合 2城市居民-成人 3：城市居民-儿童 4离休干部 5：退休干部 6：其他商业医保 7：没有医保
	 */
	@Column(name = "medical_insurance")
	@ApiModelProperty(value = "医保类型：0：城镇职工 1：新农合 2城市居民-成人 3：城市居民-儿童 4：离休干部 5：退休干部 6：其他商业医保 7：没有医保 8：未知")
	private Integer medicalInsurance;
	/**
	 * 医保是否限额 0:不限制 1：限制
	 */
	@Column(name = "medical_insurance_limit")
	@ApiModelProperty(value = "医保是否限额 0:不限制 1：限制")
	private Integer medicalInsuranceLimit;
	/**
	 * 医保限额
	 */
	@Column(name = "medical_insurance_limit_money")
	@ApiModelProperty(value = "医保限额")
	private String medicalInsuranceLimitMoney;
	/**
	 * 认证状态 0: 未认证 1：已认证 
	 */
	@Column(name = "status")
	@ApiModelProperty(value = "认证状态 0: 未认证 1：已认证 ")
	private Integer status;

	/**
	 * 审核状态 0：未审核(未入组) 1：已审核(已入组) 2：已脱组
	 */
	@Column(name = "audit_status")
	@ApiModelProperty(value = "审核状态 0：未审核(未入组) 1：已审核(已入组) 2：已脱组")
	private Integer auditStatus;

	/**
	 * 入组方式 0：护士 1：线下 
	 */
	@Column(name = "join_type")
	@ApiModelProperty(value = "入组方式 0：护士 1：线下 ")
	private Integer joinType;
	/**
	 * 协议签署状态 0：未签署 1：已签署 
	 */
	@Column(name = "agreement")
	@ApiModelProperty(value = "协议签署状态 0：未签署 1：已签署 ")
	private Integer agreement;
	/**
	 * 证件照正面
	 */
	@Column(name = "id_card_front")
	@ApiModelProperty(value = "证件照正面")
	private String idCardFront;
	/**
	 * 证件照背面
	 */
	@Column(name = "id_card_back")
	@ApiModelProperty(value = "证件照背面")
	private String idCardBack;
	/**
	 * 入组时间
	 */
	@Column(name = "join_time")
	@ApiModelProperty(value = "入组时间")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date joinTime;
	/**
	 * 脱组时间
	 */
	@Column(name = "exit_time")
	@ApiModelProperty(value = "脱组时间")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date exitTime;
	/**
	 * 首次确诊时间
	 */
	@Column(name = "first_diagnosis_time")
	@ApiModelProperty(value = "首次确诊时间")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date firstDiagnosisTime;
	/**
	 * 开始治疗时间
	 */
	@Column(name = "start_treatment_time")
	@ApiModelProperty(value = "开始治疗时间")
	private String startTreatmentTime;
	/**
	 * 既往用药品牌
	 */
	@Column(name = "history_pharmacy")
	@ApiModelProperty(value = "既往用药品牌")
	private String historyPharmacy;
	/**
	 * 当前治疗方案 0：按需治疗 1:预防治疗 2:其他
	 */
	@Column(name = "treatment_plan")
	@ApiModelProperty(value = "当前治疗方案 0：按需治疗 1:预防治疗 2:其他")
	private Integer treatmentPlan;
	/**
	 * 用药剂量
	 */
	@Column(name = "dosage")
	@ApiModelProperty(value = "用药剂量")
	private String dosage;
	/**
	 * 用药频次
	 */
	@Column(name = "dosage_frequency")
	@ApiModelProperty(value = "用药频次")
	private String dosageFrequency;
	/**
	 * 当前是否出血
	 */
	@Column(name = "hemorrhage")
	@ApiModelProperty(value = "当前是否出血")
	private Integer hemorrhage;
	/**
	 * 出血频率
	 */
	@Column(name = "bleeding_frequency")
	@ApiModelProperty(value = "出血频率")
	private Integer bleedingFrequency;
	/**
	 * 出血部位
	 */
	@Column(name = "bleeding_site")
	@ApiModelProperty(value = "出血部位")
	private String bleedingSite;
	/**
	 * 出血状态
	 */
	@Column(name = "bleeding_status")
	@ApiModelProperty(value = "出血状态")
	private String bleedingStatus;

	/**
	 * 出血单位
	 */
	@Column(name = "bleeding_unit")
	@ApiModelProperty(value = "出血单位")
	private String bleedingUnit;
	/**
	 * 康复状态
	 */
	@Column(name = "recovery_status")
	@ApiModelProperty(value = "康复状态")
	private String recoveryStatus;
	/**
	 * 物料领取时间
	 */
	@Column(name = "material_receiving_time")
	@ApiModelProperty(value = "物料领取时间")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date materialReceivingTime;
	/**
	 * 是否用药 0：否 1：是
	 */
	@Column(name = "buy_drug")
	@ApiModelProperty(value = "是否用药 0：否 1：是")
	private Integer buyDrug;

	/**
	 * 是否处方 0：否 1：是
	 */
	@Column(name = "prescription")
	@ApiModelProperty(value = "是否处方 0：否 1：是")
	private Integer prescription;

	/**
	 * 记录哪儿一次随访变为已处方
	 */
	@Column(name = "prescription_number")
	@ApiModelProperty(value = "记录哪儿一次随访变为已处方")
	private Integer prescriptionNumber;

	/**
	 * 处方时间
	 */
	@Column(name = "prescription_time")
	@ApiModelProperty(value = "处方时间")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date prescriptionTime;


	/**
	 * 既往参与项目
	 */
	@Column(name = "history_join_project")
	@ApiModelProperty(value = "既往参与项目")
	private String historyJoinProject;

	/**
	 * 患者类型 0：成人 1：儿童
	 */
	@Column(name = "patient_type")
	@ApiModelProperty(value = "患者类型 0：成人 1：儿童")
	private Integer patientType;

	/**
	 * 当前治疗品牌
	 */
	@ApiModelProperty(value = "当前治疗品牌")
	@Column(name = "current_treatment_brand")
	private String currentTreatmentBrand;

	/**
	 * 是否参加援助
	 */
	@ApiModelProperty(value = "是否参加援助")
	@Column(name = "join_support")
	private Integer joinSupport;

	/**
	 * 是否医保报销
	 */
	@ApiModelProperty(value = "是否医保报销")
	@Column(name = "medical_insurance_reimbursement")
	private Integer medicalInsuranceReimbursement;

	/**
	 * 当前入组医院名称
	 */
	@ApiModelProperty(value = "当前入组医院名称")
	@Transient
	private String hospitalName;

	/**
	 * 入组省份名称
	 */
	@ApiModelProperty(value = "入组省份名称")
	@Transient
	private String joinProvinceName;
	/**
	 * 入组城市名称
	 */
	@ApiModelProperty(value = "入组城市名称")
	@Transient
	private String joinCityName;
	/**
	 * 居住省份名称
	 */
	@ApiModelProperty(value = "居住省份名称")
	@Transient
	private String liveProvinceName;
	/**
	 * 居住城市名称
	 */
	@ApiModelProperty(value = "居住城市名称")
	@Transient
	private String liveCityName;


	@ApiModelProperty(value = "患者头像")
	@Transient
	private String headImgUrl;


	@ApiModelProperty(value = "转化原因")
	@Column(name = "change_reason")
	private String changeReason;


	@ApiModelProperty(value = "随访次数")
	@Column(name = "follow_count")
	private Integer followCount;


	@ApiModelProperty(value = "所属护士")
	@Column(name = "nurse_id")
	private String nurseId;


	@ApiModelProperty(value = "随访编号")
	@Column(name = "follow_code")
	private String followCode;

	/**
	 * 用药状态
	 */
	@ApiModelProperty(value = "用药状态")
	@Column(name = "medication_status")
	private String medicationStatus;


}
